<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link rel="stylesheet" type="text/css"
		href="#{facesContext.externalContext.request.contextPath}/css/view.css" />

</h:head>

<body>

	<div id="container">



		<div id="content">
			<h:form id="form">
			
				<script>  
	    
	                function mascara(o, f) {  
	                  v_obj = o;  
	                  v_fun = f;  
	                  setTimeout("execmascara()", 1);  
	                }  
	      
	                function execmascara() {  
	                  v_obj.value = v_fun(v_obj.value);  
	                }  
	      
	             	function valor(v) {  
		            v = v.replace(/\D/g, "");  
		            v = v.replace(/[0-9]{15}/, "invÃ¡lido");  
		            v = v.replace(/(\d{1})(\d{11})$/, "$1.$2"); // coloca ponto antes dos  
		            // Ãºltimos 11 digitos  
		            v = v.replace(/(\d{1})(\d{8})$/, "$1.$2"); // coloca ponto antes dos  
		            // Ãºltimos 8 digitos  
		            v = v.replace(/(\d{1})(\d{5})$/, "$1.$2"); // coloca ponto antes dos  
		            // Ãºltimos 5 digitos  
		            v = v.replace(/(\d{1})(\d{1,2})$/, "$1,$2"); // coloca virgula antes dos  
		            // Ãºltimos 2 digitos  
		            return v;  
	    			}  
      
   				</script> 

				<p:panel header="Despesas Gerais" style="font-size:25px;">


					<h:panelGrid id="gridFormDesp" columns="4" cellpadding="5"
						style="margin-bottom:5px; font-size:12px; font-weight:bold;">


						<h:outputLabel value="Produto* " />
						<p:inputText size="25" maxlength="60" value="#{personBean.firstname}" />

						<h:outputLabel value="Quantidade* " />
						<p:inputText maxlength="11" size="10" value="#{personBean.firstname}" />

						<h:outputLabel value="Valor*: " />
						<p:inputText value="#{ProdutoBean.valor}" maxlength="12" size="9" onkeypress="mascara(this, valor);" /> 

						<h:outputText value="Setor*: " />
							<p:selectOneMenu value="#{buttonBean.number}"> 
        					  <f:selectItem itemLabel="" itemValue="1" />				           			            
        					</p:selectOneMenu>


						<h:outputLabel value="Data " />
							<h:panelGrid>
								<p:calendar size="6" value="#{calendarBean.date2}" id="popupCal" /> 
								<h:outputText value="#{calendarBean.date2}" id="popupDate">  
                					<f:convertDateTime pattern="d/M/yyyy"/>  
            					</h:outputText> 
            				</h:panelGrid>

						<h:outputLabel value="Descrição: " />
						<p:inputTextarea size="59" maxlength="100" value="#{personBean.refComercial}" />

						<h:outputLabel value="Observações: " />
						<p:inputTextarea maxlength="500" value="#{personBean.refComercial}" />

					</h:panelGrid>
					<!-- fim da grid griFormCom -->

					<h:panelGrid id="gridBotoesDesp" columns="2" cellpadding="3"
						style="margin-bottom:5px; font-size:12px; font-weight:bold;">
						<p:commandButton value="Limpar" type="reset" />
						<p:commandButton value="Cadastrar" type="submit" />
					</h:panelGrid>
					<!-- fim da grid gridBotoesDesp -->

				</p:panel>
				<!-- fim do panel despesasGerais -->

			</h:form>
			<!-- fim do formulario -->

		</div>
		<!-- fim da div content -->


	</div>
	<!-- fim da div container -->

</body>
</html>
